The present invention relates to computer systems and more particularly to computer system processors that support predication and perform predicate prediction.
A processor manipulates and controls the flow of data in a computer system. Increasing the speed of the processor will tend to increase the computational power of the computer. Processor designers employ many different techniques to increase processor speed to create more powerful computers for consumers. One technique for increasing processor speed is called predication.
Predication is the conditional execution of instructions depending on the value of a variable called a predicate. For example, consider the two instructions:
COMPARE a, b=P
IF (P) THEN c=a+b
The first instruction, COMPARE a, b=P, determines a value for the predicate P. For example, if a is equal to b, then the value of predicate P is xe2x80x9cTruexe2x80x9d, and if a is not equal to b, then the value of predicate P is xe2x80x9cFalse.xe2x80x9d xe2x80x9cTruexe2x80x9d and xe2x80x9cFalsexe2x80x9d are typically represented in a computer system as single bit values xe2x80x9c1xe2x80x9d and xe2x80x9c0xe2x80x9d, respectively (or xe2x80x9c0xe2x80x9d and xe2x80x9c1xe2x80x9d, respectively, in a negative logic implementation).
The second instruction, IF (P) THEN c=a+b, includes two parts. The first part, IF (P) THEN, predicates (or conditions) the second part, c=a+b, on the value of predicate P. If P is true (e.g. a xe2x80x9c1xe2x80x9d), then the value of c is set equal to the value of a+b. If P is false (e.g. a xe2x80x9c0xe2x80x9d), then the second part of the instruction is skipped and the processor executes the next sequential instruction in the program code.
Unfortunately, the compare instruction, COMPARE a, b=P, can take a lengthy amount of time to process. Because of this, the execution of subsequent instructions in the program code sequence may be delayed until the compare instruction is resolved.
A new method and apparatus for performing predicate prediction is described. In one method, both a predicted predicate value for a predicate and a confidence value for the predicted predicate value are determined.
Other features and advantages of the present invention will be apparent from the accompanying drawings and the detailed description that follows.